import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';

const CitySecurityMeta: ComponentMetadata = {
  componentName: 'CitySecurity',
  title: '市保滨和',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  group: '员工管理',
  category: '数据展示',
  priority: 0,
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'CitySecurity',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: '安保项目配置',
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'securityItems',
            title: '安保项目列表',
            setter: {
              componentName: 'ArraySetter',
              props: {
                itemSetter: {
                  componentName: 'ObjectSetter',
                  props: {
                    config: {
                      items: [
                        {
                          name: 'key',
                          title: '唯一标识',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'text',
                          title: '显示文字',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'icon',
                          title: '图标路径',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'gradient',
                          title: '背景渐变',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'borderGradient',
                          title: '边框渐变',
                          setter: 'StringSetter',
                        },
                      ],
                    },
                  },
                },
              },
            },
            defaultValue: [
              {
                key: 'security',
                text: '市保',
                icon: 'http://localhost:8085/static/images/yuangongguanli/编组14.png',
                gradient: 'linear-gradient(270deg, rgba(26,119,252,0) 0%, rgba(26,119,252,0.53) 100%)',
                borderGradient: 'linear-gradient(270deg, rgba(0, 139, 255, 0), rgba(230, 244, 255, 1))',
              },
              {
                key: 'binhe',
                text: '滨和',
                icon: 'http://localhost:8085/static/images/yuangongguanli/编组21.png',
                gradient: 'linear-gradient(270deg, rgba(255,131,0,0) 0%, rgba(255,143,24,0.08) 100%)',
                borderGradient: 'linear-gradient(270deg, rgba(255, 131, 0, 0), rgba(255, 255, 255, 1))',
              },
              {
                key: 'property',
                text: '绿城物业',
                icon: 'http://localhost:8085/static/images/yuangongguanli/编组32.png',
                gradient: 'linear-gradient(273deg, rgba(14,232,22,0) 0%, rgba(27,155,32,0.2) 100%)',
                borderGradient: 'linear-gradient(270deg, rgba(0, 139, 255, 0), rgba(230, 244, 255, 1))',
              },
              {
                key: 'cleaning',
                text: '绿城保洁',
                icon: 'http://localhost:8085/static/images/yuangongguanli/编组21备份2.png',
                gradient: 'linear-gradient(270deg, rgba(255,227,46,0) 0%, rgba(255,227,46,0.59) 100%)',
                borderGradient: 'linear-gradient(270deg, rgba(255, 240, 202, 0), rgba(230, 244, 255, 1))',
              },
            ],
          },
        ],
      },
      {
        title: '事件处理',
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'onClick',
            title: '点击事件',
            setter: 'FunctionSetter',
          },
        ],
      },
      {
        title: '外观',
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'style',
            title: '自定义样式',
            setter: 'StyleSetter',
          },
          {
            name: 'className',
            title: '自定义类名',
            setter: 'StringSetter',
          },
        ],
      },
    ],
    supports: {
      style: true,
      events: ['onClick'],
    },
    component: {},
  },
};

const snippets: Snippet[] = [
  {
    title: '市保滨和',
    screenshot: '',
    schema: {
      componentName: 'CitySecurity',
      props: {
        securityItems: [
          {
            key: 'security',
            text: '市保',
            icon: 'http://localhost:8085/static/images/yuangongguanli/编组14.png',
            gradient: 'linear-gradient( 90deg, rgba(49, 109, 191, 0) 0%, rgb(49, 109, 191) 100%)',
            borderGradient: 'linear-gradient(270deg, rgba(0, 139, 255, 0), rgba(230, 244, 255, 1))',
          },
          {
            key: 'binhe',
            text: '滨和',
            icon: 'http://localhost:8085/static/images/yuangongguanli/编组21.png',
            gradient: 'linear-gradient( 90deg, rgba(163, 109, 52, 0) 0%, rgb(163, 109, 52) 100%)',
            borderGradient: 'linear-gradient(270deg, rgba(255, 131, 0, 0), rgba(255, 255, 255, 1))',
          },
          {
            key: 'property',
            text: '绿城物业',
            icon: 'http://localhost:8085/static/images/yuangongguanli/编组32.png',
            gradient: 'linear-gradient( 90deg, rgba(87, 147, 85, 0) 0%, rgb(87, 147, 85) 100%)',
            borderGradient: 'linear-gradient(270deg, rgba(0, 139, 255, 0), rgba(230, 244, 255, 1))',
          },
          {
            key: 'cleaning',
            text: '绿城保洁',
            icon: 'http://localhost:8085/static/images/yuangongguanli/编组21备份2.png',
            gradient: 'linear-gradient( 90deg, rgba(220, 199, 74, 0) 0%, rgb(220, 199, 74) 100%)',
            borderGradient: 'linear-gradient(270deg, rgba(255, 240, 202, 0), rgba(230, 244, 255, 1))',
          },
        ],
      },
    },
  },
];

export default {
  ...CitySecurityMeta,
  snippets,
};
